package com.testing.sqlTest;

import com.alibaba.fastjson.JSONObject;

import java.util.List;
import java.util.Map;

/**
 * @Classname MUTest
 * @Description 类型说明
 * @Date 2021/5/21 22:24
 * @Created by 特斯汀Roy
 */
public class MUTest {
    public static void main(String[] args) {
//        MysqlUtils mysql=new MysqlUtils();
//        System.out.println(mysql.checkLogin("ra' or 1=1 #", "123456"));
//        System.out.println(mysql.proCheckLogin("a' or 1=1 #", "123456"));
//       mysql.querySql("select * from userinfo where username='roy'");

        MysqlUtils mu = new MysqlUtils();
        List<Map<String, String>> userinfolist = mu.querySql("select * from userinfo where username='" +"roy" + "'");
        Map<String, String> userinfo = userinfolist.get(0);
        JSONObject userjson=new JSONObject();
        userjson.put("data",userinfo);
        userjson.put("status",1001);
        userjson.put("msg","恭喜您查询成功");

        System.out.println(userjson.toJSONString());
    }
}
